package cn.iocoder.an.module.mold.dal.mysql.repaircategory;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.repaircategory.RepairCategoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.repaircategory.vo.*;

/**
 * 模具维修分类 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RepairCategoryMapper extends BaseMapperX<RepairCategoryDO> {

    default PageResult<RepairCategoryDO> selectPage(RepairCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RepairCategoryDO>()
                .likeIfPresent(RepairCategoryDO::getName, reqVO.getName())
                .likeIfPresent(RepairCategoryDO::getCode, reqVO.getCode())
                .eqIfPresent(RepairCategoryDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(RepairCategoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RepairCategoryDO::getId));
    }

}